package cn.golxen.blog.service.impl;

import cn.golxen.blog.commons.vo.GetDraftListVo;
import cn.golxen.blog.entity.Draft;
import cn.golxen.blog.mapper.DraftMapper;
import cn.golxen.blog.service.DraftService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class DraftServiceImpl implements DraftService {
    @Autowired
    DraftMapper draftMapper;

    @Override
    public Integer addDraft(Draft draft) {
        return draftMapper.addDraft(draft);
    }

    @Override
    public Integer deleteDraft(String title) {
        return draftMapper.deleteDraft(title);
    }

    @Override
    public Draft getDraft(String title) {
        return draftMapper.getDraft(title);
    }

    @Override
    public List<GetDraftListVo> getDraftList() {
        return draftMapper.getDraftList();
    }
}
